<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<%@ include file="/WEB-INF/pages/include/globa.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	<title>花·生</title>
	<link rel="shortcut icon" href="resources/ico/favicon.ico" >
	<link rel="stylesheet" href="${SERVER_PATH}/resources/css/common.css" />
	<link rel="stylesheet" href="${SERVER_PATH}/resources/css/info.css" />
	<link rel="stylesheet" href="${SERVER_PATH}/resources/css/header.css" />
	<link rel="stylesheet" href="${SERVER_PATH}/resources/js/amazeui/css/amazeui.min.css">
	<style>
	
	.ood-bg{
		background-image: url('http://on01whf2s.bkt.clouddn.com/peanut/bg-orange.jpg?imageslim');
		
	}
	.news-bg{
		background-image: url('http://on01whf2s.bkt.clouddn.com/peanut/bg-black.jpg?imageslim');
		
	}
	
	
	</style>
</head>
<body>

	<div class="content">
		<%@include file="/WEB-INF/pages/include/header.jsp" %>
		
		<div class="main" id="newsContent">
			
		</div>
		<script type="text/javascript" src="${SERVER_PATH}/resources/js/amazeui/js/amazeui.min.js"></script>
		<script type="text/javascript" src="${SERVER_PATH}/resources/js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript">
			$(function(){
				getNewsList();
			});
			
			function getNewsList() {
				$.ajax({  
		             type : "GET",  //提交方式  
		             url : SERVER_PATH + "/news/v1/list",//路径  
		             type:"json",
		             success : function(result) {//返回数据根据结果进行相应的处理  
		             	if(result.rescode == 100) {
		             		var data = result.data;
		             		if(data != null) {
		             			$('#newsContent').empty();
		             			var html = '';
		             			$.each(data, function(index, item){
		             				html += '<div class="info-item'+(index%2==0?' ood-bg':' news-bg')+'">';
		             				html += '<h1 class="cate">花 · 生观</h1>';
		             				html += '<div class="title">' + item.title + '</div>';
		             				html += '<div class="sub-title">' + item.subTitle + '</div>';
		             				html += '<p class="detail-btn' +(index%2==0?' ood-a':' news-a')+'"><a href="${SERVER_PATH}/page/info/detail?nid='+item.nid+'">阅读原文</a></p></div>';
		             			});
		             			$('#newsContent').html(html);
		             		}
		             		
		             	} else {
		             		alert(result.msg);
		             	}
		             }  
		         });  
			}
		</script>
		<%@include file="/WEB-INF/pages/include/footer.jsp" %>
	</div>

</body>
</html>